﻿/*================================================================================================
	TASK 9:                                                           { Operators and Expressions}
	Write an expression that checks for given point (x, y) if it is within the circle K( (1,1), 3)
    and out of  the rectangle R(top=1, left=-1, width=6, height=2).       
=================================================================================================*/

using System;

class PointWithinCircleOutOfRectangle
{
    static void Main()
    {
        Console.Write("Enter the X coordinate of the point:");
        float pointX = float.Parse(Console.ReadLine());
        Console.Write("Enter the Y coordinate of the point:");
        float pointY = float.Parse(Console.ReadLine());
        float centerX = 1;
        float centerY = 1;
        bool withinCircleCondition = (((pointX - centerX) * (pointX - centerX)) + ((pointY - centerY) * (pointY - centerY))) <= 9;
        bool outOfRectangleCondition = (pointX < -1) || ((pointX >= -1) && ((pointY <= -1) || (pointY >= 1)));
        if (withinCircleCondition && outOfRectangleCondition)
        {
            Console.WriteLine("the Point is within circle and out of the rectangle");
        }
        else
        {
            Console.WriteLine("the Point isn't within circle or in the rectangle");
        }
    }
}

